package com.appbee.core.client.gin;

import javax.inject.Singleton;

import com.appbee.core.client.SchedulerProvider;
import com.appbee.core.client.modular.IModulRegistry;
import com.appbee.core.client.modular.impl.ModulRegistry;
import com.appbee.core.client.place.HistorianProvider;
import com.appbee.core.client.place.PlaceControl;
import com.appbee.core.client.place.PlaceHistoryHandlerProvider;
import com.appbee.core.client.ui.DefaultConfirmView;
import com.appbee.core.client.ui.IConfirmView;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.place.shared.PlaceHistoryHandler;

public class CoreGinModul extends AbstractGinModule
{

	@Override
	protected void configure()
	{
		bind(IModulRegistry.class).to(ModulRegistry.class).in(Singleton.class);
		bind(IConfirmView.class).to(DefaultConfirmView.class)
				.in(Singleton.class);
		bind(Scheduler.class).toProvider(SchedulerProvider.class)
				.in(Singleton.class);
		bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
		bind(PlaceControl.class).in(Singleton.class);
		bind(PlaceController.class).to(PlaceControl.class).in(Singleton.class);
		bind(PlaceHistoryHandler.Historian.class)
				.toProvider(HistorianProvider.class).in(Singleton.class);
		bind(PlaceHistoryHandler.class)
				.toProvider(PlaceHistoryHandlerProvider.class)
				.in(Singleton.class);

	}

}
